import React, { memo } from "react";
import { renderRoutes } from "react-router-config";
import { NavLink } from "react-router-dom";
import { discoverMenuList } from "../../common/local-data";
import { DiscoverWrapper } from "./style";

export default memo(function YYDiscover(props) {
  return (
    <DiscoverWrapper>
      <div className="top">
        <div className="wrap-v1">
          <div className="menu">
            {discoverMenuList.map((item, index) => {
              return (
                <NavLink key={item.title} to={item.path}>
                  {item.title}
                </NavLink>
              );
            })}
          </div>
        </div>
      </div>
      {renderRoutes(props.route.routes)}
    </DiscoverWrapper>
  );
});
